{% extends 'layout.html' %}


<!-- 页面内容：课程记录考勤表 -->
{% block content %}
    <div class="luffy-container">
        <form method="post">
            {% csrf_token %}
            {{ formset.management_form }}
            <table class="table table-bordered">
                <thead>
                <tr>
                    <th>姓名</th>
                    <th>考勤</th>
                </tr>
                </thead>
                <tbody>
                {% for form in formset %}
                    <tr>
                        {{ form.id }}
                        <td>{{ form.instance.student }}</td>
                        <td>{{ form.record }} <span style="color: red">{{ form.record.errors.0 }}</span></td>
                    </tr>
                {% endfor %}
                </tbody>
            </table>
            <div class="form-group">
                <div class="col-md-12">
                    <input type="submit" value="保存" class="btn btn-default form-control pull-right">
                </div>
            </div>
        </form>
    </div>
{% endblock %}